package br.com.stefanini.schs.managedbean;

import java.io.ByteArrayInputStream;
import java.io.IOException;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import org.primefaces.model.DefaultStreamedContent;
import org.primefaces.model.StreamedContent;
import org.primefaces.model.UploadedFile;


@ManagedBean
@SessionScoped
public class FotoPerfilPreVisualizarManagedBean {
	
	private UploadedFile fotoPerfil;

	public StreamedContent getFotoPrevisualizar() throws IOException {
		DefaultStreamedContent fotoPrevisualizar = null;
		fotoPrevisualizar = new DefaultStreamedContent(new ByteArrayInputStream(fotoPerfil.getContents()));
		
		return fotoPrevisualizar;
	}

	public UploadedFile getFotoPerfil() {
		return fotoPerfil;
	}

	public void setFotoPerfil(UploadedFile fotoPerfil) {
		this.fotoPerfil = fotoPerfil;
	}
	
	
}

